<%@page import="com.qdu.dao.Fenlei"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@page import="java.*"%>
<!DOCTYPE html>
<html>
    <head>


        <script type="text/JavaScript">
        function check()
        {
	 
                        if(document.form1.fenlei.value=="")
                        {
                                window.alert("请输入分类名！");
                                document.form1.admin_name.focus();
                                return false;
                        }
                        if(document.form1.fenlei.value.indexOf( " " ) != -1){
                            alert("分类名中不能含有空格！");
                            document.form1.admin_name.focus();
                            return false;
                        }
                        if(document.form1.admin_name.value.length<2||document.form1.admin_name.value.length>10)
                        {
                                window.alert("分类名长度为6-10位！");
                                document.form1.admin_name.focus();
                                return false;
                        }
        }
        </script>

    </head>


    <%
        String message = (String) request.getAttribute("message");
        if (message == null) {
            message = "";
        }
        if (!message.trim().equals("")) {
            out.println("<script language='javascript'>");
            out.println("alert('" + message + "');");
            out.println("</script>");
        }
        request.removeAttribute("message");

    %>

    <%String name = (String) session.getAttribute("name");
        if (name == null) {
            response.sendRedirect("/J02_T13_P04/admin/login.jsp");
        } else {
    %>
    <body >
        <form action="../fls" name="form1" method="post" onSubmit="return check()">
            <input type="hidden" name="method" value="add">
            <table width="100%" height="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td height="121" align="center" valign="top" bgcolor="#FFFFFF"><div align="left"><br>
                            <span class="black14">　<strong>当前位置:</strong>图书分类管理</span><br>
                        </div>
                        <table width="98%" cellpadding="0" cellspacing="0">
                            <TR bgcolor="#cccccc">
                                <TD align="center" bgColor=#ffffff><br>
                                    <br>
                                    <table width="100%" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td width="100%" height="20" colspan="2" bgcolor="#009999"><p class="w14">增加分类</p></td>
                                        </tr>
                                        <tr>
                                            <td width="100%" height="100" align="center" bgColor=#ffffff>
                                                <table width="35%" height="60" align="center" cellpadding="0" cellspacing="0">
                                                    <tr>
                                                        <td width="33%" height="29" align="right" ><strong>分类名:</strong></td>
                                                        <td width="67%" align="left" >
                                                            <input name="fenlei" type="text" class="input" id="admin_name" style="WIDTH: 160px" value="" size="30"></td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right"><input name="Submit32" type="submit" class="black12" value="确认"></td>
                                                        <td align="center"><input name="Submit3" type="reset" class="black12" value="重填"></td>
                                                    </tr>          
                                                </table></td>
                                        </tr>
                                    </table>
                                    <br>
                                </td>
                            </tr>
                        </table>
                        <br>
                        <br></TD>
                </TR>
            </table>
        </form>
    </body>
    <%}%>
</html>
